/**
 * com.cnhis.his.customer.service.Vaj2Service.java
 */
package com.mbmed.doctor.homepage.service;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mbmed.doctor.homepage.bo.Vaj2Bo;
import com.mbmed.doctor.homepage.mapper.Vaj2;

/**
 * @file  Vaj2Service.java
 * @author 刘武
 * @version 0.1
 * @todo	Vaj2服务操作接口
 * Copyright(C), 2013-2014
 *		 Shenzhen Coordinates Software Development Co., Ltd.
 * History
 *   	1. Date: 2014-10-15 11:15:52
 *      	Author: 刘武
 *      	Modification: this file was created
 *   	2. ...
 */
@Path("/vaj2")
@Component
public class Vaj2Service {
	
	private static Logger logger = Logger.getLogger(Vaj2.class);
	
	@Autowired
	private Vaj2Bo vaj2Bo;
	
	@Context
	Request request;

	
	/**
	 * 查找所有数据库记录
     * @return type : List 返回查询操作所有符合条件的记录的VO对象集合，操作失败返回null
     */
	@GET
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
    public List<Vaj2> getAll() throws Exception{
        List<Vaj2> list = new ArrayList<Vaj2>();
        return vaj2Bo.getAll();        
    }
	
    /**
     * 查找符合条件的所有数据库记录
     * @param id 与数据库中主键对应的值
     * @return type :  返回查询操作所有符合条件的记录的VO对象，操作失败返回null
     * @throws Exception
     */
	@GET
	@Path("{id}")
	@Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
    public Vaj2 getVaj2(@PathParam("id") String id) throws Exception{
    	Vaj2 vaj2 = null;
    	return vaj2Bo.get(id);        
    }
    /**
     * 向数据库中插入一条记录
     * @param vo 与数据库中记录对应的值对象
     * @return type : 返回插入操作是否成功
     * @throws Exception
     */
	@POST
	@Produces(MediaType.APPLICATION_JSON)
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	public Vaj2 saveVaj2(
			@FormParam("vaj01") java.lang.Integer vaj01,
			@FormParam("vaa01") java.lang.Integer vaa01,
			@FormParam("vaa07") java.lang.Integer vaa07,
			@FormParam("vaj04") java.lang.Integer vaj04,
			@FormParam("vaj05") java.lang.Integer vaj05,
			@FormParam("rownr") java.lang.Integer rownr,
			@FormParam("vaj01a") java.lang.Integer vaj01a,
			@FormParam("vaj01b") java.lang.Integer vaj01b,
			@FormParam("vaj09") java.lang.Integer vaj09,
			@FormParam("vaj10") java.lang.Integer vaj10,
			@FormParam("vai01") java.lang.Integer vai01,
			@FormParam("vaf01") java.lang.Integer vaf01,
			@FormParam("vak01") java.lang.Integer vak01,
			@FormParam("acf01") java.lang.Integer acf01,
			@FormParam("vaj15") java.lang.Byte vaj15,
			@FormParam("bck01a") java.lang.Integer bck01a,
			@FormParam("bck01b") java.lang.Integer bck01b,
			@FormParam("bdn01") java.lang.String bdn01,
			@FormParam("bby01") java.lang.Integer bby01,
			@FormParam("bcj02") java.lang.String bcj02,
			@FormParam("vaj21") java.lang.Byte vaj21,
			@FormParam("vaj22") java.lang.Byte vaj22,
			@FormParam("vaj23") java.lang.Byte vaj23,
			@FormParam("vaj24") java.math.BigDecimal vaj24,
			@FormParam("vaj25") java.math.BigDecimal vaj25,
			@FormParam("vaj26") java.lang.Byte vaj26,
			@FormParam("vaj27") java.lang.Integer vaj27,
			@FormParam("vaj28") java.math.BigDecimal vaj28,
			@FormParam("vaj29") java.math.BigDecimal vaj29,
			@FormParam("vaj30") java.math.BigDecimal vaj30,
			@FormParam("vaj31") java.math.BigDecimal vaj31,
			@FormParam("vaj32") java.math.BigDecimal vaj32,
			@FormParam("vaj33") java.math.BigDecimal vaj33,
			@FormParam("vaj34") java.math.BigDecimal vaj34,
			@FormParam("vaj35") java.lang.String vaj35,
			@FormParam("vaj36") java.math.BigDecimal vaj36,
			@FormParam("vaj37") java.math.BigDecimal vaj37,
			@FormParam("vaj38") java.math.BigDecimal vaj38,
			@FormParam("vaj39") java.lang.Byte vaj39,
			@FormParam("vaj40") java.math.BigDecimal vaj40,
			@FormParam("vaj41") java.math.BigDecimal vaj41,
			@FormParam("bce03a") java.lang.String bce03a,
			@FormParam("bck01c") java.lang.Integer bck01c,
			@FormParam("bce02b") java.lang.String bce02b,
			@FormParam("bce03b") java.lang.String bce03b,
			@FormParam("vaj46") java.util.Date vaj46,
			@FormParam("vaj47") java.util.Date vaj47,
			@FormParam("vaj48") java.lang.Integer vaj48,
			@FormParam("bck01d") java.lang.Integer bck01d,
			@FormParam("bce03c") java.lang.String bce03c,
			@FormParam("vaj51") java.util.Date vaj51,
			@FormParam("vaj52") java.util.Date vaj52,
			@FormParam("vaj53") java.lang.Byte vaj53,
			@FormParam("vaj54") java.lang.String vaj54,
			@FormParam("bce02d") java.lang.String bce02d,
			@FormParam("bce03d") java.lang.String bce03d,
			@FormParam("vaj57") java.lang.String vaj57,
			@FormParam("fab03") java.lang.String fab03,
			@FormParam("vaj59") java.math.BigDecimal vaj59,
			@FormParam("bce02c") java.lang.String bce02c,
			@FormParam("vaj61") java.math.BigDecimal vaj61,
			@FormParam("vaj62") java.util.Date vaj62,
			@FormParam("bck01e") java.lang.Integer bck01e,
			@FormParam("vaj64") java.util.Date vaj64,
			@FormParam("vaj65") java.lang.Byte vaj65,
			@FormParam("dsk01") java.lang.Integer dsk01,
			@FormParam("vaj67") java.math.BigDecimal vaj67,
			@FormParam("bce01e") java.lang.Integer bce01e,
			@FormParam("bce03e") java.lang.String bce03e,
			@FormParam("bck01f") java.lang.Integer bck01f,
			@FormParam("bcq04") java.lang.String bcq04,
			@Context HttpServletResponse servletResponse
	) throws Exception {
		Vaj2 vaj2 = new Vaj2();
		vaj2.setVaj01(vaj01);
		vaj2.setVaa01(vaa01);
		vaj2.setVaa07(vaa07);
		vaj2.setVaj04(vaj04);
		vaj2.setVaj05(vaj05);
		vaj2.setRownr(rownr);
		vaj2.setVaj01a(vaj01a);
		vaj2.setVaj01b(vaj01b);
		vaj2.setVaj09(vaj09);
		vaj2.setVaj10(vaj10);
		vaj2.setVai01(vai01);
		vaj2.setVaf01(vaf01);
		vaj2.setVak01(vak01);
		vaj2.setAcf01(acf01);
		vaj2.setVaj15(vaj15);
		vaj2.setBck01a(bck01a);
		vaj2.setBck01b(bck01b);
		vaj2.setBdn01(bdn01);
		vaj2.setBby01(bby01);
		vaj2.setBcj02(bcj02);
		vaj2.setVaj21(vaj21);
		vaj2.setVaj22(vaj22);
		vaj2.setVaj23(vaj23);
		vaj2.setVaj24(vaj24);
		vaj2.setVaj25(vaj25);
		vaj2.setVaj26(vaj26);
		vaj2.setVaj27(vaj27);
		vaj2.setVaj28(vaj28);
		vaj2.setVaj29(vaj29);
		vaj2.setVaj30(vaj30);
		vaj2.setVaj31(vaj31);
		vaj2.setVaj32(vaj32);
		vaj2.setVaj33(vaj33);
		vaj2.setVaj34(vaj34);
		vaj2.setVaj35(vaj35);
		vaj2.setVaj36(vaj36);
		vaj2.setVaj37(vaj37);
		vaj2.setVaj38(vaj38);
		vaj2.setVaj39(vaj39);
		vaj2.setVaj40(vaj40);
		vaj2.setVaj41(vaj41);
		vaj2.setBce03a(bce03a);
		vaj2.setBck01c(bck01c);
		vaj2.setBce02b(bce02b);
		vaj2.setBce03b(bce03b);
		vaj2.setVaj46(vaj46);
		vaj2.setVaj47(vaj47);
		vaj2.setVaj48(vaj48);
		vaj2.setBck01d(bck01d);
		vaj2.setBce03c(bce03c);
		vaj2.setVaj51(vaj51);
		vaj2.setVaj52(vaj52);
		vaj2.setVaj53(vaj53);
		vaj2.setVaj54(vaj54);
		vaj2.setBce02d(bce02d);
		vaj2.setBce03d(bce03d);
		vaj2.setVaj57(vaj57);
		vaj2.setFab03(fab03);
		vaj2.setVaj59(vaj59);
		vaj2.setBce02c(bce02c);
		vaj2.setVaj61(vaj61);
		vaj2.setVaj62(vaj62);
		vaj2.setBck01e(bck01e);
		vaj2.setVaj64(vaj64);
		vaj2.setVaj65(vaj65);
		vaj2.setDsk01(dsk01);
		vaj2.setVaj67(vaj67);
		vaj2.setBce01e(bce01e);
		vaj2.setBce03e(bce03e);
		vaj2.setBck01f(bck01f);
		vaj2.setBcq04(bcq04);

		return vaj2 = vaj2Bo.save(vaj2);

	}
	/**
     * 删除数据库中与传入的值对象对应的记录
     * @param vo 与数据库中记录对应的值对象
     * @return type : boolean 返回删除操作是否成功
     * @throws Exception
     */
	@DELETE
	@Path("{id}")
	public boolean removeVaj2(@PathParam("id") String id) throws Exception{
		if(id == null) return false;
    	return vaj2Bo.remove(id);

	}
	
}
